const swaggerJSDoc = require('swagger-jsdoc');

// swagger definition
const swaggerDefinition = {
    info: {
        title: '协同工具API',
        version: '0.0.1',
        description: '作为毕业设计swagger的api文档使用',
    },
    host: 'localhost:3000',
    basePath: '/api',
};

// initialize swagger-jsdoc
module.exports = function () {
    // options for the swagger docs
    const options = {
        // import swaggerDefinitions
        swaggerDefinition: swaggerDefinition,
        // path to the API docs
        apis: ['../routes/*.js'],
    };
    return swaggerJSDoc(options)
};
